<?php echo $this->Html->script(array('users.view','actions'),$options = array('allowCache'=>false,'safe'=>false,'inline'=>false));?>
<?php echo $this->Html->css(array('users.view','provider.index.images','form','actions'),null,array('inline'=>false));?>

<div class="box corners">

		<table width="100%" style="padding-top:0px; margin: 0px;" cellpadding="0" cellspacing="0">
			<tr>
				<td colspan="2" align="center"><h2><?php echo __('Account')?></h2></td>
			</tr>
			<tr>
				<td align="left" valign="top" style="padding-top:0px; margin: 0px;" width="50%">
					<?php echo $this->Form->create('User',array('url'=>array('plugin'=>false,'controller'=>'users','action'=>'view',$this->data['User']['id'])));?>
					<div id="tabs">
						<ul>	
							<li><a href="#tabs-0">Account</a></li>
							<li><a href="#tabs-1">Change address</a></li>
							<li><a href="#tabs-2">Change delivery</a></li>
							<li><a href="#tabs-3">Change password</a></li>
							<li><a href="#tabs-4">Change email</a></li>
						</ul>
						<div id="tabs-0">
							<table width="100%" style="padding-top:0px; margin: 0px;" cellpadding="0" cellspacing="0">
								<tr>
									<td><?php echo __('First Name & Last Name',true)?></td><td><?php echo $this->data['User']['first_name']?> <?php echo $this->data['User']['last_name']?></td>
								</tr>
								<tr>
									<td><?php echo __('Address',true)?></td><td><?php echo $this->data['User']['address1']?> <?php echo $this->data['User']['address2']?></td>
								</tr>
								<tr>
									<td><?php echo __('Zip Code, City',true)?></td><td><?php echo $this->data['User']['address4']?> <?php echo $this->data['User']['address3']?></td>
								</tr>
								<tr>
									<td><?php echo __('Email, Phone',true)?></td><td><?php echo $this->data['User']['email']?> <?php echo $this->data['User']['phone1']?></td>
								</tr>
							</table>						
						</div>
						<div id="tabs-1">
							<table width="100%" style="padding-top:0px; margin: 0px;" cellpadding="0" cellspacing="0">
								<tr>
									<td align="left" valign="top" style="padding-top:0px; margin: 0px;">
										<fieldset>
										<legend><h3><?php __("Your Billing details below"); ?></h3></legend>
										<?php
											echo $this->Form->hidden('id');
											echo $this->Form->input('first_name',array('label'=>__("First Name",true)));
											echo $this->Form->input('last_name',array('label'=>__("Last Name",true)));
											echo $this->Form->input('address1',array('label'=>__("Address",true)));
											echo $this->Form->input('address2',array('label'=>__("Address",true)));
											echo $this->Form->input('address3',array('label'=>__("City",true)));
											echo $this->Form->input('address4',array('label'=>__("Zip Code",true)));
											//echo $this->Form->input('address5',array('label'=>__("Country",true),'options'=>$countrycod));
											echo $this->Form->input('email',array('label'=>__("E-mail",true),'readonly'=>true));
										?>
										</fieldset>
									</td>
								</tr>
							</table>
							<?php echo $this->Form->submit('Submit')?>
						</div>
						<div id="tabs-2">
							<table width="100%" style="padding-top:0px; margin: 0px;" cellpadding="0" cellspacing="0">
								<tr>
									<td align="left" valign="top" style="padding-top:0px; margin: 0px;">										
										<fieldset>
									 		<legend><h3><?php __('Your Delivery details below'); ?></h3></legend>
									 		<div class="input text required">
												<label for="CustomerDeliveryAsBilling"><?php echo __("Same as Billing Details?",true);?></label>
												<?php 
												echo $this->Form->checkbox('delivery_as_billing',array('hiddenField' => false)); 
												$this->Js->get('#CustomerDeliveryAsBilling');
												$this->Js->event( 'change', 'copyDelivery($("#CustomerDeliveryAsBilling").attr("checked"));' ,true);
												?>	
											</div>
										<?php									
											echo $this->Form->input('delivery_first_name',array('label'=>__("First Name",true),'class'=>'delivery_files'));
											echo $this->Form->input('delivery_last_name',array('label'=>__("Surname",true),'class'=>'delivery_files'));
											echo $this->Form->input('delivery_address1',array('label'=>__("Address",true),'class'=>'delivery_files'));
											echo $this->Form->input('delivery_address2',array('label'=>__("Address",true),'class'=>'delivery_files'));
											echo $this->Form->input('delivery_address3',array('label'=>__("City",true),'class'=>'delivery_files'));
											echo $this->Form->input('delivery_address4',array('label'=>__("Zip Code",true),'class'=>'delivery_files'));
// 											echo $this->Form->input('delivery_address5',array('label'=>__("Country",true),'class'=>'delivery_files','options'=>$countrycod));
										?>
										</fieldset>
									</td>
								</tr>
							</table>
							<?php echo $this->Form->submit('Submit')?>
						</div>
						<div id="tabs-3">
									<table width="100%" style="padding-top:0px; margin: 0px;" cellpadding="0" cellspacing="0">
										<tr>
											<td align="left" valign="top" style="padding-top:0px; margin: 0px;">
												<fieldset>
												<legend><h3><?php __("Change Your Password below"); ?></h3></legend>
												<p>If you would like to change your password please enter your existing password, then your new password and submit your request.</p>
												<?php													
													echo $this->Form->input('old_password',array('label'=>__("Please enter your current password",true),'type'=>'password'));
													echo $this->Form->input('new_password',array('label'=>__("Please enter a new password",true),'type'=>'password'));
												?>
												</fieldset>
											</td>
						
										</tr>
									</table>
									<?php echo $this->Form->submit('Submit')?>
						</div>
						<div id="tabs-4">
									<table width="100%" style="padding-top:0px; margin: 0px;" cellpadding="0" cellspacing="0">
										<tr>
											<td align="left" valign="top" style="padding-top:0px; margin: 0px;">
												<fieldset>
												<legend><h3><?php __("Change Your Email below"); ?></h3></legend>
												<p>If you would like to change your e-mail please enter your current password, then your new email and submit your request.</p>
												<?php													
													echo $this->Form->input('email_password',array('label'=>__("Please enter your current password",true),'type'=>'password'));
													echo $this->Form->input('new_email',array('label'=>__("Please enter a new email",true)));
												?>
												</fieldset>
											</td>
						
										</tr>
									</table>
									<?php echo $this->Form->submit('Submit')?>
						</div>
					</div>
					<?php echo $this->Form->end();?>
				</td>
			</tr>
		</table>
</div>

<div class="box corners">
	<?php if($session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'admin' || $session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'manag'){?>
	<div class="actions main_actions">
		<h3><?php __('Actions'); ?></h3>
		<ul>
			<li><?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $this->Form->value('User.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $this->Form->value('User.id'))); ?></li>
			<li><?php echo $this->Html->link(__('List Users', true), array('action' => 'index'));?></li>
	
			<li><?php echo $this->Html->link(__('New User', true), array('action' => 'add_user')); ?> </li>
		</ul>
	</div>
	<?php }?>	
	
	<div class="related">
		<h2 class="t-center"><?php echo __('Carts')?></h2>
		<div id="tabs-related">
			<ul>
				<li><a href="#tabs-related-1"><?php __('Sendet')?></a></li>
				<li><a href="#tabs-related-2"><?php __('Payments')?></a></li>
			</ul>
	
			<div id="tabs-related-1">
				<?php if (!empty($this->data['VidYachtCharter'])):?>
					<table cellpadding = "0" cellspacing = "0" class="index">
					<?php
						$i = 0;
						foreach ($this->data['VidYachtCharter'] as $yachtCharter):
							$class = null;
							if ($i++ % 2 == 0) {
								$class = ' class="altrow"';
							}
						?>			
							
							
						<tr<?php echo $class;?>>
							<td class="image-index">
								<div class="gallery">
								<?php 
								$file = $fileUpload->image($yachtCharter['file_name'],array('autoResize'=>true,'imagePathOnly'=>true,'class'=>'large','alt'=> $yachtCharter['name'],'width'=>800,'height'=>800));
								$thumb = $fileUpload->image($yachtCharter['file_name'],array('autoResize'=>true,'imagePathOnly'=>true,'class'=>'thumb','alt'=> $yachtCharter['name'],'width'=>150,'height'=>140));
							
								$ext = strtolower($fileUpload->_getExt());
								echo $html->link("&nbsp;",$file,array('escape'=>false,'class'=>"highslide",  'onclick'=>"return hs.expand(this)",'style'=>"background: url(".$thumb.") center no-repeat;"))?>
								</div>
							</td>
							<td>
								
								<table width="100%" cellpadding="1" cellspacing="1" class="data">
									<tr>
										<td colspan="3" class="index-yachts-name"><?php echo $yachtCharter['name']; ?>&nbsp;</td>
										<td class="index-yachts-name"><?php echo $yachtCharter['date_from']; ?>&nbsp;</td>
										<td class="index-yachts-name"><?php echo $yachtCharter['date_to']; ?>&nbsp;</td>
										<td class="index-yachts-price" align="right"><?php echo $this->Number->currency($yachtCharter['price'],'EUR') ?>&nbsp;</td>
									</tr>
									<tr>
										<td valign="top">
											<?php echo __('Model',true)?><br/>
											<?php echo __('Type',true) ?><br/>
											<?php echo __('Destination') ?>
				
										</td>
										<td colspan="3" valign="top">
											<?php echo $yachtCharter['model_name']; ?><br/>
											<?php echo $yachtCharter['type_name']; ?><br/>
											<?php echo $yachtCharter['destination_name'];?>
										</td>
										<td colspan="2" align="right">
											<?php if($yachtCharter['commission'] != 0){ echo __('Commission',true).': '.$yachtCharter['commission'].'%';} ?><br/>
											<?php if($yachtCharter['discount'] != 0){ echo __('Discount').': '.$yachtCharter['discount'].'%';} ?>
										</td>
									</tr>
									<tr>
										<th width="16%"><?php echo __('Year') ?>&nbsp;</th>
										<th width="16%"><?php echo __('Lenght',true) ?>&nbsp;</th>
										<th width="16%"><?php echo __('Cabins',true) ?>&nbsp;</th>
										<th width="16%"><?php echo __('Berths') ?>&nbsp;</th>
										<th width="16%"><?php echo __('Showers') ?>&nbsp;</th>	
										<th width="16%"><?php echo __('WC') ?>&nbsp;</th>							
									</tr>
									<tr>
										<td align="center"><?php echo $yachtCharter['year_of_build']; ?>&nbsp;</td>
										<td align="center"><?php echo $yachtCharter['length']; ?>&nbsp;</td>
										<td align="center"><?php echo $yachtCharter['cabins']; ?>&nbsp;</td>
										<td align="center"><?php echo $yachtCharter['berths']; ?>&nbsp;-&nbsp;<?php echo $yachtCharter['berths_description']; ?>&nbsp;</td>
										<td align="center"><?php echo $yachtCharter['showers']; ?>&nbsp;</td>
										<td align="center"><?php echo $yachtCharter['wc']; ?>&nbsp;</td>
									</tr>
								</table>
							</td>
							<td class="actions">
								<?php echo $this->Html->link(__('View', true), array('controller' => 'yacht_charters', 'action' => 'view', $yachtCharter['id']),array('class'=>'view')); ?>
							</td>
						</tr>
				
					<?php endforeach; ?>
					</table>
				<?php endif; ?>
			</div>
			
			<div id="tabs-related-2">
			
			
			</div>
		</div>
	</div>
</div>